#include <func.h>
#include "Bussiness.h"
#include "Network.h"

#define SERVPORT "12306"

int main(int argc, char *argv[])
{
    // ./client host
    if (argc != 2) {
        error(1, 0, "Usage: ./client host");
    }

    int sockfd = tcp_connect(argv[1], SERVPORT);
    printf("sockfd = %d\n", sockfd);

    //for(;;) {
        // 用户输入命令
        // 发送命令到服务器
        // 接收服务器执行的结果
    //}
    
    // 发送一个命令
    send(sockfd, "cmd", 3, 0);
    recv_file(sockfd);
    printf("INFO: %s downloaded\n", "file1");
    close(sockfd);

    return 0;
}

